package client;

import client.util.ChatingProcessor;
import client.util.DataStreamManager;
import client.util.NetworkManager;

public class ClientThread implements Runnable{

	@Override
	public void run() {		
		while (NetworkManager.on) {
			String str = DataStreamManager.readData();

			if (str.equals("logout")) {
				ChatingProcessor.logout();
			} else if (str.indexOf('|') > 0) {
				System.out.println(str.replace('|', '\n'));
			} else {
				System.out.println(str);
			}
		}
	}
}
